Section 3.6.4.5.3
Jitter

Jitter can be used to introduce some noise to the sampling locations. This may help to reduce aliasing artifacts at the cost of an increased noise level in the image. But since the human visual system is much more forgiving to noise than it is to regular patterns, this is not much of a problem.

By default jittering is not used. The values should be smaller than 1.0.

Note that the jittering is used even if the supersampling is not used.

***FIX ME*** [DB]


Section 3.6.4.6
Halo Modifiers

This section covers all general halo modifiers. They are:

halo { [ turbulence <TURBULENCE> ] [ octaves OCTAVES ] [ omega OMEGA ] [ lambda LAMBDA ] [ frequency FREQUENCY ] [ phase PHASE ] [ scale <VECTOR> ] [ rotate <VECTOR> ] [ translate <VECTOR> ] }

***FIX ME*** [DB]


Section 3.6.4.6.1
Turbulence Modifier

***FIX ME*** [DB]

Section 3.6.4.6.2
Octaves Modifier

***FIX ME*** [DB]

Section 3.6.4.6.3
Omega Modifier

***FIX ME*** [DB]

Section 3.6.4.6.4
Lambda Modifier

***FIX ME*** [DB]

Section 3.6.4.6.5
Frequency Modifier

The frequency parameter adjusts the number of times the density interval is mapped onto itself, i.e. the range from 0.0 to 1.0, before it is mapped onto the color map. The formula doing this is:

f_new(r) = (f(r) * FREQUENCY + PHASE) modulo 1.0

Thus the halo color map will be repeated by FREQUENCY.

***FIX ME*** [DB]


Section 3.6.4.6.6
Phase Modifier

The phase parameter determines the offset at which the mapping of the density field onto itself starts. The formula doing this is:

f_new(r) = (f(r) * FREQUENCY + PHASE) modulo 1.0

Thus the color entry for density f(r)=0 can be moved to PHASE modulo 1.0.

***FIX ME*** [DB]


Section 3.6.4.6.7
Transformation Modifiers

Halos can be transformed using the rotate, scale and translate keywords. You have to be careful that you don't move the density field out of the container object though.

***FIX ME*** [DB]


Section 3.6.5
Special Textures

Special textures are complex textures made up of multiple textures. The component textures may be plain textures or may be made up of special textures. A plain texture has just one pigment, normal and finish statement. Even a pigment with a pigment_map is still one pigment and thus considered a plain texture as are normals with normal_map statements.

Special textures use either a texture_map to specify a blend or pattern of textures or they use a bitmap similar to an image_map called a material_map.

There are restrictions on using special textures. A special texture may not be used as a default texture. See the "#default" language directive. A special texture cannot be used as a layer in a layered texture however you may use layered textures as any of the textures contained within a special texture.

{/HEADER 3 Texture Maps}

In addition to specifying blended color with a color_map, or pigment_map, you may create a blend of textures using a texture_map. The syntax for a texture_map is identical to pigment_map except you specify a texture in each map entry.

A texture_map is specified by...

texture{ PATTERN_TYPE texture_map { [ NUM_1 TEXTURE_BODY_1] [ NUM_2 TEXTURE_BODY_2] [ NUM_3 TEXTURE_BODY_3] ... } TEXTURE_MODIFIERS... }

Where NUM_1, NUM_2... are float values between 0.0 and 1.0 inclusive. A TEXTURE_BODY is anything that would normally appear inside a texture {...} statement but the texture keyword and {} braces are not needed. NOTE: the [] brackets are part of the actual statement. They are not notational symbols denoting optional parts. The brackets surround each entry in the map. There may be from 2 to 256 entries in the map.

For example,

texture { gradient x //this is the PATTERN_TYPE texture_map { [0.3 pigment{Red} finish{phong 1}] [0.3 T_Wood11] //this is a texture identifier [0.6 T_Wood11] [0.9 pigment{DMFWood4} finish{Shiny}] } }

When the gradient x function returns values from 0.0 to 0.3 then the red highlighted texture is used. From 0.3 to 0.6 the texture identifier T_Wood11 is used. From 0.6 up to 0.9 a blend of T_Wood11 and a shiny DMFWood4 is used. From 0.9 on up only the shiny wood is used.

Texture maps may be nested to any level of complexity you desire. The textures in a map may have color_map or texture_maps or any type of texture you want.

The blended area of a texture map works by fully calculating both contributing textures in their entirety and then linearly interpolating the apparent colors. This means that reflection, refraction and lighting calculations are done twice for every point. This is in contrast to using a pigment_map and normal_map in a plain texture, where the pigment is computed, then the normal, then reflection, refraction, and lighting are calculated once for that point.

Entire textures may also be used with the block patterns such as checker, hexagon and brick. For example...

texture { checker texture { T_Wood12 scale .8 } texture { pigment { White_Marble } finish { Shiny } scale .5 } } }

Note that in the case of block patterns, the texture {...} wrapping is required around the texture information. Also note that this syntax prohibits the use of a layered texture however you can work around this by declaring a texture identifier for the layered texture and referencing the identifier.

A texture_map is also used with the average pattern type. See "Average" for details.


Section 3.6.5.1
Tiles

Earlier versions of POV-Ray had a special texture called tiles texture that created a checkered pattern of textures. Although it is still supported for backwards computability, you should use checker block texture pattern described in the previous "texture_map" section rather than tiles textures.

Section 3.6.5.2
Material Maps

The material_map special texture extends the concept of image_map to apply to entire textures rather than solid colors. A material_map allows you to wrap a 2-D bit-mapped texture pattern around your 3-D objects.

Instead of placing a solid color of the image on the shape like an image_map, an entire texture is specified based on the index or color of the image at that point. You must specify a list of textures to be used like a "texture palette" rather than the usual color palette.

When used with mapped file types such as GIF, and some PNG and TGA images, the index of the pixel is used as an index into the list of textures you supply. For unmapped file types such as some PNG and TGA images, the 8 bit value of the red component in the range 0-255 is used as an index.

If the index of a pixel is greater than the number of textures in your list then the index is taken modulo N where N is the length of your list of textures.


Section 3.6.5.2.1
Specifying a Material Map

The syntax for material_map is...

texture { material_map { FILE_TYPE "filename" BITMAP_MODIFIERS... texture {...} // First used for index 0 texture {...} // Second texture used for index 1 texture {...} // Third texture used for index 2 texture {...} // Fourth texture used for index 3 // and so on for however many used. } TRANSFORMATION... }

If particular index values are not used in an image then it may be necessary to supply dummy textures. It may be necessary to use a paint program or other utility to examine the map file's palette to determine how to arrange the texture list.

Where FILE_TYPE is one of the following keywords gif, tga, iff, ppm, pgm, png, or sys. This is followed by the name of the file using any valid string expression. Several optional modifiers may follow the file specification. The modifiers are described below. Note: Earlier versions of POV-Ray allowed some modifiers before the FILE_TYPE but that syntax is being phased out in favor of the syntax described here.

Filenames specified in the material_map statements will be searched for in the home (current) directory first, and if not found, will then be searched for in directories specified by any +L switches or Library_Path= options. This would facilitate keeping all your material maps files in a separate subdirectory, and specifying a library path to them. Note that any operating system default paths are not searched unless you also specify them as a Library_Path.

By default, the material is mapped onto the X-Y plane. The material is "projected" onto the object as though there were a slide projector somewhere in the -Z direction. The material exactly fills the square area from x,y coordinates (0,0) to (1,1) regardless of the bitmap's original size in pixels. If you would like to change this default, you may translate, rotate or scale the texture to map it onto the object's surface as desired.

The file name is optionally followed by one or more BITMAP_MODIFIERS. See "bitmap modifiers" for other details.

After a material_map statement but still inside the texture statement you may apply any legal texture modifiers. Note that no other pigment, normal, finish or halo statements may be added to the texture outside the material_map. This is illegal:

texture { material_map { gif "matmap.gif" texture {T1} texture {T2} texture {T3} } finish {phong 1.0} }

The finish must be individually added to each texture.

Note that earlier versions of POV-Ray allowed such specifications but they were ignored. The above restrictions on syntax were necessary for various bug fixes. This means some POV-Ray 1.0 scenes using material_maps many need minor modifications that cannot be done automatically with the version compatibility mode.

The textures within a material_map texture may be layered but material_map textures do don't work as part of a layered texture. To use a layered texture inside a material_map you must declare it as a texture identifier and invoke it in the texture list.


Section 3.6.6
Layered Textures

It is possible to create a variety of special effects using layered textures. A layered texture is one where several textures that are partially transparent are laid one on top of the other to create a more complex texture. The different texture layers show through the transparent portions to create the appearance of one texture that is a combination of several textures.

You create layered textures by listing two or more textures one right after the other. The last texture listed will be the top layer, the first one listed will be the bottom layer. All textures in a layered texture other than the bottom layer should have some transparency. For example:

object { My_Object texture {T1} // the bottom layer texture {T2} // a semi-transparent layer texture {T3} // the top semi-transparent layer }

In this example T2 shows only where T3 is transparent and T1 shows only where T2 and T3 are transparent.

The color of underlying layers is filtered by upper layers but the results do not look exactly like a series of transparent surfaces. If you had a stack of surfaces with the textures applied to each, the light would be filtered twice: once on the way in as the lower layers are illuminated by filtered light and once on the way out. Layered textures do not filter the illumination on the way in. Other parts of the lighting calculations work differently as well. The result look great and allow for fantastic looking textures but they are simply different from multiple surfaces. See STONES.INC in the standard include files for some magnificent layered textures.

Note layered textures must use the "texture {...}" wrapped around any pigment, normal or finish statements. Do not use multiple pigment, normal or finish statements without putting them inside the texture statement.

Layered textures may be declared. For example:

#declare Layered_Examp= texture {T1} texture {T2} texture {T3}

Then invoke it as follows:

object { My_Object texture { Layer_Examp // Any pigment, normal or finish here // modifies the bottom layer only. } }

If you wish to use a layered texture in a block pattern such as checker, hexagon, or brick or in a material_map, you must declare it first and then reference it inside a single texture statement. A special texture cannot be used as a layer in a layered texture however you may use layered textures as any of the textures contained within a special texture.


Section 3.6.7
Patterns

POV-Ray uses a method called "3D solid texturing" to define the color, bumpiness and other properties of a surface. You specify the way that the texture varies over a surface by specifying a pattern. Patterns are used in pigments, normals and texture maps.

All patterns in POV-Ray are three dimensional. For every point in space, each pattern has a unique value. Patterns do not wrap around a surface like putting wallpaper on an object. The patterns exist in 3-d and the objects are carved from them like carving an object from a solid block of wood or stone.

Consider a block of wood. It contains light and dark bands that are concentric cylinders being the growth rings of the wood. On the end of the block you see these concentric circles. Along its length you see lines that are the veins. However the pattern exists throughout the entire block. If you cut or carve the wood it reveals the pattern inside. Similarly an onion consists of concentric spheres that are visible only when you slice it. Marble stone consists of wavy layers of colored sediments that harden into rock.

These solid patterns can be simulated using mathematical functions. Other random patterns such as granite or bumps and dents can be generated using a random number system and a noise function.

In each case, the x, y, z coordinate of a point on a surface is used to compute some mathematical function that returns a float value. When used with color maps or pigment maps, that value looks up the color of the pigment to be used. In normal statements, the pattern function result modifies or perturbs the surface normal vector to give a bumpy appearance. Used with a texture map, the function result determines which combinations of entire textures to be used.

See the sections "pigment" , "color_map" , "normal" , and "texture_map" for more details on how to use patterns. The following sections describe each pattern.


Section 3.6.7.1
Agate


The agate pattern.

This pattern is a banded pattern similar to marble, but it uses a specialized built-in turbulence function that is different from the traditional turbulence. The traditional turbulence can be used as well but it is generally not necessary because agate is already very turbulent. You may control the amount of the built-in turbulence by adding the agate_turb keyword followed by a float value. For example:

pigment { agate agate_turb 0.5 color_map { ... } }

The agate pattern uses the ramp_wave wave type by default but may use any wave type. The pattern may be used with color_map, pigment_map, normal_map, slope_map and texture_map.


Section 3.6.7.2
Average

Technically average is not a pattern type but it is listed here because the syntax is similar to other patterns. Typically a pattern type specifies how colors or normals are chosen from a pigment map or normal map however average tells POV-Ray to average together all of the patterns you specify. Average was originally designed to be used in a normal statement with a normal map as a method of specifying more than one normal pattern on the same surface. However average may be used in a pigment statement with a pigment map, or in a texture statement with a texture map to average colors too.

When used with pigments, the syntax is:

pigment { average pigment_map { [WEIGHT_1 PIGMENT_BODY_1] [WEIGHT_2 PIGMENT_BODY_2] ... [WEIGHT_n PIGMENT_BODY_n] } PIGMENT_MODIFIER }

A PIGMENT_BODY is anything that would normally appear inside a pigment {...} statement but the pigment keyword and the {} braces are not needed. NOTE: the [] brackets are part of the actual statement. They are not notational symbols denoting optional parts. The brackets surround each entry in the map. There may be from 2 to 256 entries in the map. The values WEIGHT_1, WEIGHT_2, etc. are optional float values that specify the relative weight of each pigment. The default weight if unspecified is 1.0. All of the pigments are computed separately, the colors are then weighted and averaged.

Similarly you may use a texture map in a texture statement. All textures are fully computed. The resulting colors are then weighted and averaged.

When used with a normal map in a normal statement, multiple copies of the original surface normal are created and are perturbed by each pattern. The perturbed normals are then weighted, added and normalized.

See the sections "pigment_map" , "normal_map" , and "texture_map" for more information.


Next Section
Table Of Contents